module.exports = {
    myRand(arr, num) {
        var newArr = [];
        rand(num);    //随机 n 条

        function rand(k) {
            if (k == 0) {
                return;
            }
            var index = Math.floor(Math.random() * arr.length);
            var flag = true;
            S.each(newArr, function (v) {
                if (v == arr[index]) {
                    flag = false;
                }
            });
            if (flag) {
                newArr.push(arr[index]);
                k--;
            }
            rand(k);
        }
        return newArr;
    }
}
